//
//  JSCollectionViewHelper.h
//  JSBasicFramework
//
//  Created by Apple on 2018/8/2.
//  Copyright © 2018年 Apple. All rights reserved.
//

#import "JSListHelper.h"

typedef UIEdgeInsets (^SectionInsets)(id list, NSInteger section);
/** 每行的间距 */
typedef CGFloat (^MinimumLineSpacingForSection)(id list, NSInteger section);
/** 每列的间距 */
typedef CGFloat (^MinimumInteritemSpacingForSection)(id list, NSInteger section);
/** 自定义每组背景颜色 */
typedef UIColor *(^CustomBgColorForSection)(id list, NSInteger section);



@interface JSCollectionViewHelper : JSListHelper


@property (nonatomic, copy) SectionInsets sectionInsets;
@property (nonatomic, copy) MinimumLineSpacingForSection lineSpacing;
@property (nonatomic, copy) MinimumInteritemSpacingForSection itemSpacing;
@property (nonatomic, copy) CustomBgColorForSection customSectionBgColor;
@property (nonatomic, strong, readonly) UICollectionView *collectionView;
@property (nonatomic, strong, readonly) UICollectionViewLayout *collectionViewLayout;


-(instancetype)initWithOwner:(id)owner Regiter:(RegisterWithIdentifer)registerBefore
               sectionNumber:(SectionNumber)sectionNumber
                   rowNumber:(RowNumber)rowNumber
               cellIdentifer:(CellIdentifer)cellIdentifer
             headerIdentifer:(HeaderIdentifer)headerIdentifer
             footerIdenrifer:(FooterIdentifer)footerIdentifer
                cellWithSize:(CellWithSize)cellWithSize
              headerWithSize:(HeaderWithSize)headerWithSize
              footerWithSize:(FooterWithSize)footerWithSize
                  cellConfig:(CellConfigData)cellConfig
                headerConfig:(HeaderConfigData)headerConfig
                footerConfig:(FooterConfigData)footerConfig
          didSelectIndexPath:(DidSelectIndexPath)didSelectIndexPath
               sectionInsets:(SectionInsets)sectionInsets
                 lineSpacing:(MinimumLineSpacingForSection)lineSpacing
            interItemSpacing:(MinimumInteritemSpacingForSection)itemSpacing;
/**
 * 初始化列表控件
 * @param layout 如果不传 将自动创建 UICollectionViewFlowLayout 默认垂直滚动方向
 */
-(instancetype)initWithLayout:(UICollectionViewLayout *)layout Regiter:(RegisterWithIdentifer)registerBefore
                sectionNumber:(SectionNumber)sectionNumber
                    rowNumber:(RowNumber)rowNumber
                cellIdentifer:(CellIdentifer)cellIdentifer
              headerIdentifer:(HeaderIdentifer)headerIdentifer
              footerIdenrifer:(FooterIdentifer)footerIdentifer
                 cellWithSize:(CellWithSize)cellWithSize
               headerWithSize:(HeaderWithSize)headerWithSize
               footerWithSize:(FooterWithSize)footerWithSize
                   cellConfig:(CellConfigData)cellConfig
                 headerConfig:(HeaderConfigData)headerConfig
                 footerConfig:(FooterConfigData)footerConfig
           didSelectIndexPath:(DidSelectIndexPath)didSelectIndexPath
                sectionInsets:(SectionInsets)sectionInsets
                  lineSpacing:(MinimumLineSpacingForSection)lineSpacing
             interItemSpacing:(MinimumInteritemSpacingForSection)itemSpacing;

@end
